void main() {
  //
  print('=======1. string 转 number========');
  String str = '123';
  int myNum = 123;

  print('=======转换整数类型========');
  int num = int.parse(str);
  print(num is int);

  print('=======转换浮点数类型========');
  double num2 = double.parse(str);
  print(num2 is double);

  print('=======转换报错========');
  try {
    double num3 = double.parse('');
    print(num3 is double);
  } catch (err) {
    print('err');
  }

  //
  print('=======2. number 转 string ========');
  var myStr = myNum.toString();
  print(myStr is String);

}
